home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / pxewin.zip / PXLISTBX.HPP < prev    next >
C/C++ Source or Header  |  1992-02-27  |  3KB  |  102 lines

  1. // PXEWIN - (C) Copyright 1992 by Beam Engineering, INC.
  2.  
  3. // PXLISTBX.HPP //
  4.  
  5. // Contents ----------------------------------------------------------------
  6. //
  7. //    This module contains the PXListBox class.
  8. //
  9. // End ---------------------------------------------------------------------
  10.  
  11. // External Reference Name for this Header ---------------------------------
  12.  
  13. #ifndef PXLISTBX_HPP
  14.     #define PXLISTBX_HPP
  15.  
  16. // End ---------------------------------------------------------------------
  17.  
  18. // Interface Dependencies --------------------------------------------------
  19.  
  20. #ifndef BROWSE_HPP
  21.     #include "browse.hpp"
  22. #endif // BROWSE_HPP //
  23.  
  24. // End ---------------------------------------------------------------------
  25.  
  26. // class PXListBox //
  27.  
  28. class PXListBox:public TListBox
  29. {
  30. private:
  31.     PDBDISPLAY my_display;            /* Display object pointer */
  32.     PBrowser my_parent;            /* Pointer to parent window
  33.                         */
  34.     virtual const Pchar streamableName()
  35.     const                    /* Defines the streamable
  36.                            name for this class. */
  37.     {
  38.         return "PXListBox";
  39.     }
  40. protected:
  41.     virtual Pvoid read(Ripstream);        /* Read persistant object */
  42.     virtual void write(Ropstream);        /* Write persistant object */
  43.     PXListBox(StreamableInit):        /* Persistant object
  44.                            constructor */
  45.         TListBox(streamableInit)
  46.     {
  47.  
  48.     }
  49.                         /* Redefine this procedure
  50.                            to include additional
  51.                            keystrokes not handled */
  52.     virtual void DefWndProc(RTMessage Msg);
  53. public:
  54.     PXListBox(PBrowser AParent,
  55.         int AnId,int X,int Y,int W,int H,
  56.         PTModule AModule = NULL);
  57.     static PTStreamable build();        /* Build persistant object */
  58.                         /* Responds to a selection
  59.                            change by selecting all
  60.                            fields of a given record
  61.                         */
  62.     virtual void LBNSelChange(RTMessage Msg) =
  63.         [NF_FIRST + LBN_SELCHANGE];
  64.  
  65.     // Redefine WMPaint so that list boxes are not drawn when the
  66.     // the Update flag is reset.  Since the OWL will do screen refresh
  67.     // on the list boxes for each new entrie in the box, it is better
  68.     // to do a paint after the list has completely been updated.
  69.  
  70.     virtual void WMPaint(RTMessage Msg) = [WM_FIRST + WM_PAINT];
  71. };
  72.  
  73. // Description -------------------------------------------------------------
  74. //
  75. //    The PXListBox class is a modification of the TListBox class.  A
  76. //    pointer to the DBDISPLAY object is passed.  This object is used
  77. //    to call the SelRecord function.  If a selection event occurs in
  78. //    any of the list boxes, the list box calls the SelRecord function
  79. //    that selects all the other fields so that the record bar changes
  80. //    to coorespond to that item.  The focus remains set at the item
  81. //    you have selected.
  82. //
  83. // End ---------------------------------------------------------------------
  84.  
  85. // Define inserters and extractors for persistant objects:
  86.  
  87. inline Ripstream operator >> (Ripstream is,RPXListBox cl)
  88.     {return is >> (RTStreamable)cl;}
  89.  
  90. inline Ripstream operator >> (Ripstream is,RPPXListBox cl)
  91.     {return is >> (RPvoid)cl;}
  92.  
  93. inline Ropstream operator << (Ropstream os,RPXListBox cl)
  94.     {return os << (RTStreamable)cl;}
  95.  
  96. inline Ropstream operator << (Ropstream os,PPXListBox cl)
  97.     {return os << (PTStreamable)cl;}
  98.  
  99. #endif // PXLISTBX_HPP //
  100.  
  101.  
  102.